1. Field of the Invention
This invention relates generally to controlling the flow of program instructions in a microprocessor, and more particularly, to serializing the flow of program instructions in a microprocessor using branch instructions.
2. Description of the Related Art
A microprocessor typically operates in different states or modes. For example, a microprocessor may operate in both a protected mode and an unprotected mode. The microprocessor may operate in either a 16-bit execution mode or a 32-bit execution mode. Also, certain instructions, such as a far call instruction, may change the code segment of the instructions the microprocessor is executing. Hereinafter, such events, and other like events, are referred to as serialization events. More generally, a serialization event is defined as any event for which it is desirable to serialize the machine before continuing execution.
After a serialization event, it is desirable to flush the pipeline and update the state before continuing execution. Because certain instructions are executed by the microprocessor out-of-order, it is first necessary to let the instructions prior to the serializing event finish executing. A known method to serialize a microprocessor is to issue a serializing micro-instruction. Hardware in the microprocessor must recognize the serialization micro-instruction and stall the pipeline at the correct point until the state can be updated. In some cases, when instruction restart is necessary, an explicit command to fetch the next instruction must be issued. Serialization using this method requires that special serializing micro-instructions be added to the instruction set, and that hardware in the microprocessor be adapted to recognize these special instructions.
The present invention is directed to overcoming, or at least reducing the effects of, one or more of the problems set forth above.